(defmacro defined [& var]
    `(try 
        (or 
            (boolean (resolve ~@var)) 
            (not (nil? (eval ~@var)))
        ) (catch Exception e# false)
    )
)

(println "getInteger")
(if (defined 'getInteger)
	(throw (Exception. "getInteger already defined!"))
)
(def getInteger (callback "getInteger"))
(def getIntegerType (class getInteger))
(println getIntegerType)
(println getInteger)
(if-not (= getIntegerType Integer)
	(throw (Exception. "getInteger not Integer!"))
)
(callback "setInteger" getInteger)

(println "getIntegerVector")
(if (defined 'getIntegerVector)
	(throw (Exception. "getIntegerVector already defined!"))
)
(def getIntegerVector (callback "getIntegerVector"))
(def getIntegerVectorType (class (get getIntegerVector 0)))
(println getIntegerVectorType)
(println getIntegerVector)
(if-not (= getIntegerVectorType Integer)
	(throw (Exception. "getIntegerVector not Integer!"))
)
(callback "setIntegerVector" getIntegerVector)

(println "getIntegerVectorAsList")
(if (defined 'getIntegerVectorAsList)
	(throw (Exception. "getIntegerVectorAsList already defined!"))
)
(def getIntegerVectorAsList (callback "getIntegerVectorAsList"))
(def getIntegerVectorAsListType (class (get getIntegerVectorAsList 0)))
(println getIntegerVectorAsListType)
(println getIntegerVectorAsList)
(if-not (= getIntegerVectorAsListType Integer)
	(throw (Exception. "getIntegerVectorAsList not Integer!"))
)
(callback "setIntegerVectorAsList" getIntegerVectorAsList)

(println "getIntegerMatrix")
(if (defined 'getIntegerMatrix)
	(throw (Exception. "getIntegerMatrix already defined!"))
)
(def getIntegerMatrix (callback "getIntegerMatrix"))
(def getIntegerMatrixType (class (get (get getIntegerMatrix 0) 0)))
(println getIntegerMatrixType)
(println getIntegerMatrix)
(if-not (= getIntegerMatrixType Integer)
	(throw (Exception. "getIntegerMatrix not Integer!"))
)
(callback "setIntegerMatrix" getIntegerMatrix)

(println "getIntegerMatrixAsList")
(if (defined 'getIntegerMatrixAsList)
	(throw (Exception. "getIntegerMatrixAsList already defined!"))
)
(def getIntegerMatrixAsList (callback "getIntegerMatrixAsList"))
(def getIntegerMatrixAsListType (class (get (get getIntegerMatrixAsList 0) 0)))
(println getIntegerMatrixAsListType)
(println getIntegerMatrixAsList)
(if-not (= getIntegerMatrixAsListType Integer)
	(throw (Exception. "getIntegerMatrixAsList not Integer!"))
)
(callback "setIntegerMatrixAsList" getIntegerMatrixAsList)
